package com.test;

import java.util.Scanner;

import org.junit.Test;

public class HomeWork {
	public static void main(String[] args) {
		System.out.println("for循环的9*9乘法表为:");
		for (int i = 1; i <= 9; i++) {
			for (int j = 1; j <= i; j++) {
				int num1 = i * j;

				System.out.print(i + "*" + j + "=" + num1 + " ");
				if (i == j)
					System.out.print('\r');
			}
		}
		System.out.println("while循环的9*9乘法表为:");
		int a = 0;
		while (a < 9) {
			a++;
			int b = 0;
			while (b < a) {
				b++;
				int num2 = a * b;
				System.out.print(a + "*" + b + "=" + num2 + " ");
				if (a == b)
					System.out.print('\r');
			}
		}
		System.out.println("do while循环的9*9乘法表为:");

		int c = 0;
		do {
			c++;
			int d = 0;
			do {
				d++;
				int num3 = c * d;
				System.out.print(c + "*" + d + "=" + num3 + " ");
				if (c == d)
					System.out.print('\r');
			} while (d < c);

		} while (c < 9);

	}

	@Test
	public void test1() {
		int i = 1;
		do {
			System.out.println(i);
			i++;
		} while (i < 10);
	}
}
